import { get, del } from 'utils/request';
import { getParamFromSearch, get_years_to_now } from 'utils';

const id = getParamFromSearch().id;

if (id) {
  get(`resume/resumes/${id}`).done(d => {
    $('#name').html(d.name || '待填写');
    $('#sex').html(['女', '男'][+d.sex] || '待定');
    $('#birth').html(d.birth || '待选择');
    $('#phone').html(d.phone || '待填写');
    $('#job-status').html(['离职-随时到岗', '在职-暂不考虑', '在职-考虑机会', '在职-月内到岗'][d.job_status] || '待定');
    $('#years').html(d.begin_work ? get_years_to_now(d.begin_work) : 0);
    $('#advantage').html(d.advantage);
    $('body').show();
  });
} else {
  alert('链接有误，请检查');
}